//防抖函数
const debounce = (func: Function, delay: number) => {
    let timerId: ReturnType<typeof setTimeout> | null;
    return function (...args: any[]) {
      clearTimeout(timerId);
      timerId = setTimeout(() => {
        func.apply(this, args);
      }, delay);
    };
  };

  export { debounce };